<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
				xmlns:ui="http://java.sun.com/jsf/facelets"
	  			xmlns:h="http://java.sun.com/jsf/html"
	  			xmlns:f="http://java.sun.com/jsf/core"
				xmlns:a4j="http://richfaces.org/a4j"
				xmlns:rich="http://richfaces.org/rich"
				xmlns:bf="http://www.bssmanager.com/jsf"
				xmlns:c="http://java.sun.com/jstl/core" >

<style>
	.class1 {
		line-height:80%;
		padding-left: 10px;
	}

</style>

<f:view locale="en_US"  >

	<h:form >
		  <rich:panelBar height="100%">
		  
		    <rich:panelBarItem style="height:100%"
	            label="Hot Links">
	            <h:panelGrid columns="1">
	            	<a4j:commandLink onclick="selectPage('admission.jsf')" value="Check In" />
	            	<a4j:commandLink onclick="selectPage('admissionUpdate.jsf')" value="Update" />
	            	<a4j:commandLink onclick="selectPage('exit.jsf')" value="Check Out" />
	            	<a4j:commandLink onclick="selectPage('generateId.jsf')" value="Generate ID" />
	            	<a4j:commandLink onclick="selectPage('payment.jsf')" value="Payments" rendered="false"/>
	            	<a4j:commandLink onclick="selectPage('dailyDepositAndRefund.jsf')" value="Daily Deposit &amp; Refund" />
	            	<a4j:commandLink onclick="selectPage('roomOccupancy.jsf')" value="Room Occupancy" />
	            	<a4j:commandLink onclick="selectPage('attendent.jsf')" value="Attendents" />
	            	<a4j:commandLink onclick="selectPage('search.jsf')" value="Search" />	            	
					<a4j:commandLink value="Backup" action="#{backupUtil.backup}" limitToList="true" style="color: black" ajaxSingle="true"
											onclick="showLoading();" oncomplete="hideLoading();alert('#{backupUtil.statusText}');"						/>
					
	            </h:panelGrid>
	        </rich:panelBarItem>
	        <rich:panelBarItem style="height:100%" rendered="true" 
	            label="Last Check-ins">
	            <rich:dataList value="#{genericService.lastCheckins}" var="admission" styleClass="class1" >
	            	<h:panelGrid columns="1">
		            	<h:outputText value="#{admission.patient.name}" />
		            	<h:outputText value="#{admission.id}" />
						<h:outputText value="#{admission.dateOfAdmission}">
							<f:convertDateTime pattern="dd MMM yyyy HH:mm" timeZone="#{preferences.timeZone.ID}"   />
						</h:outputText>
					</h:panelGrid>
				</rich:dataList>				
	        </rich:panelBarItem>
	        <rich:panelBarItem style="height:100%" rendered="true" 
	            label="Last Check-outs">
	            <rich:dataList value="#{genericService.lastCheckouts}" var="admission" styleClass="class1" >
	            	<h:panelGrid columns="1">
		            	<h:outputText value="#{admission.patient.name}" />
		            	<h:outputText value="#{admission.id}" />
						<h:outputText value="#{admission.dateOfExit}">
							<f:convertDateTime pattern="dd MMM yyyy HH:mm" timeZone="#{preferences.timeZone.ID}"   />
						</h:outputText>
					</h:panelGrid>
				</rich:dataList>				
	        </rich:panelBarItem>
	        <rich:panelBarItem style="height:100%" rendered="false"
	            label="Last 10 Check-outs"> 
	            	<rich:dataList value="#{topFinder['admission,dateOfExit,10']}" var="admission" styleClass="class1" >
	            		<h:panelGrid columns="1">
			            	<h:outputText value="#{admission.patient.name}" />
							<h:outputText value="#{admission.dateOfExit}">
								<f:convertDateTime pattern="dd MMM yy HH:mm" timeZone="#{preferences.timeZone.ID}"  />
							</h:outputText>
						</h:panelGrid>
					</rich:dataList>           
	        </rich:panelBarItem>
		</rich:panelBar>
	</h:form>
</f:view>
</ui:composition>